home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / ASM-ARM / ARCH-RPC / IDE.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  941b  |  43 lines

  1. /*
  2.  * linux/include/asm-arm/arch-rpc/ide.h
  3.  *
  4.  * Copyright (c) 1997 Russell King
  5.  *
  6.  * Modifications:
  7.  *  29-07-1998    RMK    Major re-work of IDE architecture specific code
  8.  */
  9. #include <asm/irq.h>
  10.  
  11. /*
  12.  * Set up a hw structure for a specified data port, control port and IRQ.
  13.  * This should follow whatever the default interface uses.
  14.  */
  15. static __inline__ void
  16. ide_init_hwif_ports(hw_regs_t *hw, int data_port, int ctrl_port, int irq)
  17. {
  18.     ide_ioreg_t reg = (ide_ioreg_t) data_port;
  19.     int i;
  20.  
  21.     memset(hw, 0, sizeof(*hw));
  22.  
  23.     for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
  24.         hw->io_ports[i] = reg;
  25.         reg += 1;
  26.     }
  27.     hw->io_ports[IDE_CONTROL_OFFSET] = (ide_ioreg_t) ctrl_port;
  28.     hw->irq = irq;
  29. }
  30.  
  31. /*
  32.  * This registers the standard ports for this architecture with the IDE
  33.  * driver.
  34.  */
  35. static __inline__ void
  36. ide_init_default_hwifs(void)
  37. {
  38.     hw_regs_t hw;
  39.  
  40.     ide_init_hwif_ports(&hw, 0x1f0, 0x3f6, IRQ_HARDDISK);
  41.     ide_register_hw(&hw, NULL);
  42. }
  43.